package com.zjw.zy.datasource.dao;

import androidx.annotation.NonNull;
import androidx.room.Dao;
import androidx.room.Delete;
import androidx.room.Insert;
import androidx.room.Query;
import androidx.room.Update;

import com.zjw.zy.bean.MemorandumItem;

import java.util.List;

/**
 * @author ：zhong.jw
 * @date ：Created in 2022/9/30 9:02
 */

@Dao
public interface MemorandumDao {

    @Insert
    void insertItem(@NonNull MemorandumItem item);


    @Delete
    void deleteItem(@NonNull MemorandumItem item);


    @Update
    void updateItem(@NonNull MemorandumItem item);


    @Query("SELECT * FROM memorandum ORDER BY date DESC")
    List<MemorandumItem> queryAll();


    @Query("SELECT * FROM memorandum WHERE id =:id")
    MemorandumItem queryOneById(int id);
}
